import logging
import yagmail

def log_set():
    logging.basicConfig(level=logging.DEBUG,format='%(message)s',filename='log.txt')

def send_email(file):
    #1.QQ邮箱2.密码3.host
    mail=yagmail.SMTP(user='',password='',host='smtp.qq.com')
    mail.send(to='',subject='',contents="请查看",attachments=file)